/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.appspot.ittrick.drive.trick.bind;

import com.appspot.ittrick.drive.trick.task.GetRootFolderTask;
import com.appspot.ittrick.drive.trick.task.LaodFolderListTask;
import javafx.beans.binding.BooleanBinding;

/**
 *
 * @author takahara
 */
public class MainProgressVisibleBinding extends BooleanBinding {

    private GetRootFolderTask getRootFolderTask;
    private LaodFolderListTask laodFolderListTask;

    /**
     * コンストラクタ
     */
    public MainProgressVisibleBinding(
            GetRootFolderTask getRootFolderTask,
            LaodFolderListTask laodFolderListTask
            ) {
        this.getRootFolderTask = getRootFolderTask;
        this.laodFolderListTask = laodFolderListTask;

        super.bind(getRootFolderTask.runningProperty());
        super.bind(laodFolderListTask.runningProperty());
    }

    @Override
    protected boolean computeValue() {

        if(getRootFolderTask.runningProperty().getValue()) return true;
        if(laodFolderListTask.runningProperty().getValue()) return true;

        return false;
    }
}
